using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;

public class TestOutputPass : ScriptableRenderPass
{
    private RenderTargetIdentifier source { get; set; }
    private RenderTargetHandle destination { get; set; }
    const string m_ProfilerTag = "Test Output";

    public TestOutputPass(RenderPassEvent evt)
    {
        renderPassEvent = evt;
    }

    public void Setup(RenderTargetIdentifier source, RenderTargetHandle destination)
    {
        this.source = source;
        this.destination = destination;
    }

    public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData)
    {
        CommandBuffer cmd = CommandBufferPool.Get(m_ProfilerTag);

        cmd.Blit(source, destination.Identifier());

        context.ExecuteCommandBuffer(cmd);
        CommandBufferPool.Release(cmd);
    }
}
